import { Node } from "cc";
import { HudView } from "../display/HudView";

export class Hud {
    private _view: HudView;
    private _viewNode: Node;
    public get view(): HudView {
        if (!this._view) {
            this._view = this._viewNode.getComponent(HudView);
        }
        return this._view;
    }

    public constructor(view: Node) {
        this._viewNode = view;
        this._view = view.getComponent(HudView);
    }
}
